import 'package:gold/generated/json/base/json_convert_content.dart';
import 'package:gold/model/gold_recover_order_model.dart';
import 'package:gold/model/address_model.dart';

import 'package:gold/model/order_model.dart';


GoldRecoverOrderModel $GoldRecoverOrderModelFromJson(Map<String, dynamic> json) {
  final GoldRecoverOrderModel goldRecoverOrderModel = GoldRecoverOrderModel();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    goldRecoverOrderModel.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['user_id']);
  if (userId != null) {
    goldRecoverOrderModel.userId = userId;
  }
  final String? method = jsonConvert.convert<String>(json['method']);
  if (method != null) {
    goldRecoverOrderModel.method = method;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    goldRecoverOrderModel.type = type;
  }
  final double? weight = jsonConvert.convert<double>(json['weight']);
  if (weight != null) {
    goldRecoverOrderModel.weight = weight;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    goldRecoverOrderModel.price = price;
  }
  final double? totalPrice = jsonConvert.convert<double>(json['total_price']);
  if (totalPrice != null) {
    goldRecoverOrderModel.totalPrice = totalPrice;
  }
  final int? shopId = jsonConvert.convert<int>(json['shop_id']);
  if (shopId != null) {
    goldRecoverOrderModel.shopId = shopId;
  }
  final String? arriveTime = jsonConvert.convert<String>(json['arrive_time']);
  if (arriveTime != null) {
    goldRecoverOrderModel.arriveTime = arriveTime;
  }
  final int? addressId = jsonConvert.convert<int>(json['address_id']);
  if (addressId != null) {
    goldRecoverOrderModel.addressId = addressId;
  }
  final String? pickupTime = jsonConvert.convert<String>(json['pickup_time']);
  if (pickupTime != null) {
    goldRecoverOrderModel.pickupTime = pickupTime;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    goldRecoverOrderModel.status = status;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    goldRecoverOrderModel.createdAt = createdAt;
  }
  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
  if (updatedAt != null) {
    goldRecoverOrderModel.updatedAt = updatedAt;
  }
  final String? shipmentAt = jsonConvert.convert<String>(json['shipment_at']);
  if (shipmentAt != null) {
    goldRecoverOrderModel.shipmentAt = shipmentAt;
  }
  final String? receiptAt = jsonConvert.convert<String>(json['receipt_at']);
  if (receiptAt != null) {
    goldRecoverOrderModel.receiptAt = receiptAt;
  }
  final String? auditAt = jsonConvert.convert<String>(json['audit_at']);
  if (auditAt != null) {
    goldRecoverOrderModel.auditAt = auditAt;
  }
  final String? confirmAt = jsonConvert.convert<String>(json['confirm_at']);
  if (confirmAt != null) {
    goldRecoverOrderModel.confirmAt = confirmAt;
  }
  final String? auditVideo = jsonConvert.convert<String>(json['audit_video']);
  if (auditVideo != null) {
    goldRecoverOrderModel.auditVideo = auditVideo;
  }
  final String? expressNumber = jsonConvert.convert<String>(json['express_number']);
  if (expressNumber != null) {
    goldRecoverOrderModel.expressNumber = expressNumber;
  }
  final double? auditWeight = jsonConvert.convert<double>(json['audit_weight']);
  if (auditWeight != null) {
    goldRecoverOrderModel.auditWeight = auditWeight;
  }
  final double? auditTotalPrice = jsonConvert.convert<double>(json['audit_total_price']);
  if (auditTotalPrice != null) {
    goldRecoverOrderModel.auditTotalPrice = auditTotalPrice;
  }
  final String? expressCom = jsonConvert.convert<String>(json['express_com']);
  if (expressCom != null) {
    goldRecoverOrderModel.expressCom = expressCom;
  }
  final String? expressNu = jsonConvert.convert<String>(json['express_nu']);
  if (expressNu != null) {
    goldRecoverOrderModel.expressNu = expressNu;
  }
  final ExpressModel? express = jsonConvert.convert<ExpressModel>(json['express']);
  if (express != null) {
    goldRecoverOrderModel.express = express;
  }
  final AddressModel? address = jsonConvert.convert<AddressModel>(json['address']);
  if (address != null) {
    goldRecoverOrderModel.address = address;
  }
  final RecoverRefundModel? refund = jsonConvert.convert<RecoverRefundModel>(json['refund']);
  if (refund != null) {
    goldRecoverOrderModel.refund = refund;
  }
  return goldRecoverOrderModel;
}

Map<String, dynamic> $GoldRecoverOrderModelToJson(GoldRecoverOrderModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['user_id'] = entity.userId;
  data['method'] = entity.method;
  data['type'] = entity.type;
  data['weight'] = entity.weight;
  data['price'] = entity.price;
  data['total_price'] = entity.totalPrice;
  data['shop_id'] = entity.shopId;
  data['arrive_time'] = entity.arriveTime;
  data['address_id'] = entity.addressId;
  data['pickup_time'] = entity.pickupTime;
  data['status'] = entity.status;
  data['created_at'] = entity.createdAt;
  data['updated_at'] = entity.updatedAt;
  data['shipment_at'] = entity.shipmentAt;
  data['receipt_at'] = entity.receiptAt;
  data['audit_at'] = entity.auditAt;
  data['confirm_at'] = entity.confirmAt;
  data['audit_video'] = entity.auditVideo;
  data['express_number'] = entity.expressNumber;
  data['audit_weight'] = entity.auditWeight;
  data['audit_total_price'] = entity.auditTotalPrice;
  data['express_com'] = entity.expressCom;
  data['express_nu'] = entity.expressNu;
  data['express'] = entity.express?.toJson();
  data['address'] = entity.address?.toJson();
  data['refund'] = entity.refund?.toJson();
  return data;
}

extension GoldRecoverOrderModelExtension on GoldRecoverOrderModel {
  GoldRecoverOrderModel copyWith({
    int? id,
    int? userId,
    String? method,
    String? type,
    double? weight,
    double? price,
    double? totalPrice,
    int? shopId,
    String? arriveTime,
    int? addressId,
    String? pickupTime,
    String? status,
    String? createdAt,
    String? updatedAt,
    String? shipmentAt,
    String? receiptAt,
    String? auditAt,
    String? confirmAt,
    String? auditVideo,
    String? expressNumber,
    double? auditWeight,
    double? auditTotalPrice,
    String? expressCom,
    String? expressNu,
    ExpressModel? express,
    AddressModel? address,
    RecoverRefundModel? refund,
  }) {
    return GoldRecoverOrderModel()
      ..id = id ?? this.id
      ..userId = userId ?? this.userId
      ..method = method ?? this.method
      ..type = type ?? this.type
      ..weight = weight ?? this.weight
      ..price = price ?? this.price
      ..totalPrice = totalPrice ?? this.totalPrice
      ..shopId = shopId ?? this.shopId
      ..arriveTime = arriveTime ?? this.arriveTime
      ..addressId = addressId ?? this.addressId
      ..pickupTime = pickupTime ?? this.pickupTime
      ..status = status ?? this.status
      ..createdAt = createdAt ?? this.createdAt
      ..updatedAt = updatedAt ?? this.updatedAt
      ..shipmentAt = shipmentAt ?? this.shipmentAt
      ..receiptAt = receiptAt ?? this.receiptAt
      ..auditAt = auditAt ?? this.auditAt
      ..confirmAt = confirmAt ?? this.confirmAt
      ..auditVideo = auditVideo ?? this.auditVideo
      ..expressNumber = expressNumber ?? this.expressNumber
      ..auditWeight = auditWeight ?? this.auditWeight
      ..auditTotalPrice = auditTotalPrice ?? this.auditTotalPrice
      ..expressCom = expressCom ?? this.expressCom
      ..expressNu = expressNu ?? this.expressNu
      ..express = express ?? this.express
      ..address = address ?? this.address
      ..refund = refund ?? this.refund;
  }
}

RecoverRefundModel $RecoverRefundModelFromJson(Map<String, dynamic> json) {
  final RecoverRefundModel recoverRefundModel = RecoverRefundModel();
  final String? refundNo = jsonConvert.convert<String>(json['refund_no']);
  if (refundNo != null) {
    recoverRefundModel.refundNo = refundNo;
  }
  final String? type = jsonConvert.convert<String>(json['type']);
  if (type != null) {
    recoverRefundModel.type = type;
  }
  final String? price = jsonConvert.convert<String>(json['price']);
  if (price != null) {
    recoverRefundModel.price = price;
  }
  final String? reason = jsonConvert.convert<String>(json['reason']);
  if (reason != null) {
    recoverRefundModel.reason = reason;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    recoverRefundModel.createdAt = createdAt;
  }
  final String? expressCom = jsonConvert.convert<String>(json['express_com']);
  if (expressCom != null) {
    recoverRefundModel.expressCom = expressCom;
  }
  final String? expressNu = jsonConvert.convert<String>(json['express_nu']);
  if (expressNu != null) {
    recoverRefundModel.expressNu = expressNu;
  }
  final ExpressModel? express = jsonConvert.convert<ExpressModel>(json['express']);
  if (express != null) {
    recoverRefundModel.express = express;
  }
  return recoverRefundModel;
}

Map<String, dynamic> $RecoverRefundModelToJson(RecoverRefundModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['refund_no'] = entity.refundNo;
  data['type'] = entity.type;
  data['price'] = entity.price;
  data['reason'] = entity.reason;
  data['created_at'] = entity.createdAt;
  data['express_com'] = entity.expressCom;
  data['express_nu'] = entity.expressNu;
  data['express'] = entity.express?.toJson();
  return data;
}

extension RecoverRefundModelExtension on RecoverRefundModel {
  RecoverRefundModel copyWith({
    String? refundNo,
    String? type,
    String? price,
    String? reason,
    String? createdAt,
    String? expressCom,
    String? expressNu,
    ExpressModel? express,
  }) {
    return RecoverRefundModel()
      ..refundNo = refundNo ?? this.refundNo
      ..type = type ?? this.type
      ..price = price ?? this.price
      ..reason = reason ?? this.reason
      ..createdAt = createdAt ?? this.createdAt
      ..expressCom = expressCom ?? this.expressCom
      ..expressNu = expressNu ?? this.expressNu
      ..express = express ?? this.express;
  }
}